<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>04_apply-基本使用</title>
    </head>
    <body>
        <script>
            var person = {
                name:'马志强'
            }

            var dog = {
                name:'黑豹',
                eat:function(){
                    console.log(this);
                    console.log('饭');
                }
            }

            dog.eat();

            // apply修改了this指向   变成了第一个参数
            dog.eat.apply(person);


        </script>
    </body>
</html>